<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			.time{
				width: 150px;
				height: 100px;
				background: palevioletred;
				color: papayawhip;
				font-size: 24px;
				float: left;
				line-height: 100px;
				text-align: center;
				border: aquamarine 2px solid;
			}
		</style>
	</head>
	<body>
		<div class="time"></div>
		<div class="time"></div>
		<div class="time"></div>
		<div class="time"></div>
		<div class="time"></div>
		<script>
			var time = document.getElementsByClassName("time");
			var timego = new Date('2030 10-13 20:00:00');
//			console.log(timego);
            var count_times = setInterval(function(){
            	var localtime = new Date();
            	var times = timego - localtime;
            	var hao = (times % 1000);
            	var sec = parseInt(times / 1000);
            	var sescth = (sec % 60);
            	var min = parseInt((sec / 60)) % 60;
            	var hour = parseInt((sec / 3600)) % 24;
            	var days = parseInt((sec / 86400)) % 365;
            	time[0].innerHTML = days +'天';
            	time[1].innerHTML = hour +'时';
            	time[2].innerHTML = min  +'分';
            	time[3].innerHTML = sescth+'秒';
            	var res = '';
            	if(hao<10){
            		res ="00"+hao;
            	}else if(hao >= 10 && hao < 100){
            		res = '0' + hao;
            	}else{
            		res = hao;
            	}
            	time[4].innerHTML = res + '毫秒';
            },1)
		</script>
	</body>
</html>
